
local MyApp = class("MyApp", cc.load("mvc").AppBase)

function MyApp:onCreate()
    math.randomseed(os.time())
    -- 生成设备唯一标识
    local deviceId = cc.UserDefault:getInstance():getStringForKey("deviceid", "")
    if deviceId == "" then
        deviceId = Util.uuid()
        cc.UserDefault:getInstance():setStringForKey("deviceid", deviceId)
        cc.UserDefault:getInstance():flush()
    end
end

return MyApp
